from django.conf.urls import url
from rest_framework.routers import DefaultRouter
from rest_framework_jwt.views import obtain_jwt_token
from apps.meiduo_admin import views
from . import views

urlpatterns = [
    url(r'^authorizations/$', obtain_jwt_token),
    url(r'^statistical/total_count/$', views.TotalCountView.as_view()),
    url(r'^statistical/day_increment/$', views.DayIncrementView.as_view()),
    url(r'^statistical/day_active/$', views.DayActiveView.as_view()),
    url(r'^statistical/day_orders/$', views.DayOrderView.as_view()),
    url(r'^statistical/month_increment/$', views.MonthIncrementView.as_view()),
    url(r'^statistical/goods_day_views/$', views.GoodsDayViews.as_view()),

    url(r'^users/$', views.UserView.as_view()),
    url(r'^goods/simple/$', views.GoodsSimpleView.as_view()),
    url(r'^skus/categories/$', views.SKUCategoryView.as_view()),
    url(r'^goods/(?P<pk>\d+)/specs/$', views.GoodsPKSpecsView.as_view()),
    url(r'^skus/simple/$', views.SKUSimpleView.as_view()),

]

router = DefaultRouter()
router.register('goods/specs', views.GoodsSpecsView, base_name='goodspecs')
router.register('skus/images', views.ImageViewSet, base_name='skusimages')
router.register('skus', views.SKUGoodsView, base_name='skus')
urlpatterns += router.urls
